$(document).ready(function(){
    demanda();
});

function demanda()
{
    $('.year').on('click',function(){
        var val = $(this).attr('id');
        $.post(axServices, {'year' : val}, function(data){
            $('#listServiceByYear').html(data);
            graph();
        });
    });
}

function graph()
{
    var manana = $("#manana").val();
    var tarde = $("#tarde").val();
    var noche = $("#noche").val();
    $("#barDemanda").sparkline([manana,tarde,noche], 
    {
        type: 'bar',
        zeroAxis: false,
        barColor: '#ff00ff',
        negBarColor: '#f04040 ',
        zeroColor: '#ffffff',
        height: '250',
        barWidth: 26
    }); 
}